package com.kl.forum.service;

import com.kl.forum.dao.CircleReplyLightMapper;
import com.kl.forum.entity.CircleReplyLight;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class CircleReplyLightService {
    @Autowired
    private CircleReplyLightMapper circleReplyLightMapper;
    public int insert(Integer replyId,Integer userId){
        CircleReplyLight light=new CircleReplyLight();
        light.setReplyId(replyId);
        light.setUserId(userId);
        light.setStatus(1);
        return circleReplyLightMapper.insertSelective(light);
    }
    public  int update(CircleReplyLight circleReplyLight){
        return circleReplyLightMapper.insertSelective(circleReplyLight);
    }
    public CircleReplyLight findCircleReplyLight(Integer replyId,Integer userId){
        Map map=new HashMap();
        map.put("replyId",replyId);
        map.put("userId",userId);
        return circleReplyLightMapper.findCircleReplyLight(map);
    }
}
